package com.example.demo.common;

import java.io.Serializable;

/**
 * 接口返回统一格式
 *
 * @param <T>
 */
public class ResultMsgVo<T> implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String code = "0000";
    private String msg;
    private long serviceTime = System.currentTimeMillis();
    private T data; // 数据
    public static final String RETCODE_0000 = "0000"; // 成功
    public static final String RETCODE_1000 = "1000"; // token 验证失败
    public static final String RETCODE_2000 = "2000"; // 业务异常
    public static final String RETCODE_2001 = "2001"; // 权限异常
    public static final String RETCODE_3000 = "3000"; //
    public static final String RETCODE_4000 = "4000"; // 系统异常

    public ResultMsgVo() {
	}

    public ResultMsgVo(T data) {
		super();
		this.data = data;
	}

	public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public long getServiceTime() {
        return serviceTime;
    }

    public void setServiceTime(long serviceTime) {
        this.serviceTime = serviceTime;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
